package cn.guat.smartpark.controller;


import cn.guat.smartpark.common.R;
import cn.guat.smartpark.entity.FirePipelines;
import cn.guat.smartpark.service.FirePipelinesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/pipelines")
public class FirePipelinesController {

    @Autowired
    private FirePipelinesService firePipelinesService;

    /**
     * 通过管线id查询管线数据
     * @param pipeId
     * @return
     */
    @GetMapping
    public R<FirePipelines> getPipelinesById(String pipeId){
        System.out.println("查询管线id为："+pipeId);
        FirePipelines firePipelines=firePipelinesService.getPipelinesById(pipeId);
        if(firePipelines!=null){
            return R.success(firePipelines);
        }
        return R.error("对象信息获取失败，请稍后重试");
    }

}
